home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Interfaces / PInterfaces / CTBUtilities.p < prev    next >
Encoding:
Text File  |  1994-11-11  |  5.3 KB  |  225 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        CTBUtilities.p
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. }
  16.  
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT CTBUtilities;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __CTBUTILITIES__}
  27. {$SETC __CTBUTILITIES__ := 1}
  28.  
  29. {$I+}
  30. {$SETC CTBUtilitiesIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33.  
  34. {$IFC UNDEFINED __MEMORY__}
  35. {$I Memory.p}
  36. {$ENDC}
  37. {    Types.p                                                        }
  38. {        ConditionalMacros.p                                        }
  39. {    MixedMode.p                                                    }
  40.  
  41. {$IFC UNDEFINED __DIALOGS__}
  42. {$I Dialogs.p}
  43. {$ENDC}
  44. {    Errors.p                                                    }
  45. {    Windows.p                                                    }
  46. {        Quickdraw.p                                                }
  47. {            QuickdrawText.p                                        }
  48. {        Events.p                                                }
  49. {            OSUtils.p                                            }
  50. {        Controls.p                                                }
  51. {            Menus.p                                                }
  52. {    TextEdit.p                                                    }
  53.  
  54. {$IFC UNDEFINED __STANDARDFILE__}
  55. {$I StandardFile.p}
  56. {$ENDC}
  57. {    Files.p                                                        }
  58.  
  59. {$IFC UNDEFINED __APPLETALK__}
  60. {$I AppleTalk.p}
  61. {$ENDC}
  62.  
  63. {$PUSH}
  64. {$ALIGN MAC68K}
  65. {$LibExport+}
  66.  
  67. CONST
  68. {    version of Comm Toolbox Utilities    }
  69.     curCTBUVersion                = 2;
  70. {    Error codes/types    }
  71.     ctbuGenericError            = -1;
  72.     ctbuNoErr                    = 0;
  73.  
  74.     
  75. TYPE
  76.     CTBUErr = OSErr;
  77.  
  78.  
  79. CONST
  80.     chooseDisaster                = -2;
  81.     chooseFailed                = -1;
  82.     chooseAborted                = 0;
  83.     chooseOKMinor                = 1;
  84.     chooseOKMajor                = 2;
  85.     chooseCancel                = 3;
  86.  
  87.     
  88. TYPE
  89.     ChooseReturnCode = INTEGER;
  90.  
  91.  
  92. CONST
  93.     nlOk                        = 0;
  94.     nlCancel                    = 1;
  95.     nlEject                        = 2;
  96.  
  97.     
  98. TYPE
  99.     NuLookupReturnCode = INTEGER;
  100.  
  101.  
  102. CONST
  103.     nameInclude                    = 1;
  104.     nameDisable                    = 2;
  105.     nameReject                    = 3;
  106.  
  107.     
  108. TYPE
  109.     NameFilterReturnCode = INTEGER;
  110.  
  111.  
  112. CONST
  113.     zoneInclude                    = 1;
  114.     zoneDisable                    = 2;
  115.     zoneReject                    = 3;
  116.  
  117.     
  118. TYPE
  119.     ZoneFilterReturnCode = INTEGER;
  120.  
  121.     DialogHookProcPtr = ProcPtr;  { FUNCTION DialogHook(item: INTEGER; theDialog: DialogPtr): INTEGER; }
  122.     DialogHookUPP = UniversalProcPtr;
  123.  
  124. CONST
  125.     uppDialogHookProcInfo = $000003A0; { FUNCTION (2 byte param, 4 byte param): 2 byte result; }
  126.  
  127. FUNCTION NewDialogHookProc(userRoutine: DialogHookProcPtr): DialogHookUPP;
  128.     {$IFC NOT GENERATINGCFM }
  129.     INLINE $2E9F;
  130.     {$ENDC}
  131.  
  132. FUNCTION CallDialogHookProc(item: INTEGER; theDialog: DialogPtr; userRoutine: DialogHookUPP): INTEGER;
  133.     {$IFC NOT GENERATINGCFM}
  134.     INLINE $205F, $4E90;
  135.     {$ENDC}
  136.  
  137. CONST
  138. {    Values for hookProc items        }
  139.     hookOK                        = 1;
  140.     hookCancel                    = 2;
  141.     hookOutline                    = 3;
  142.     hookTitle                    = 4;
  143.     hookItemList                = 5;
  144.     hookZoneTitle                = 6;
  145.     hookZoneList                = 7;
  146.     hookLine                    = 8;
  147.     hookVersion                    = 9;
  148.     hookReserved1                = 10;
  149.     hookReserved2                = 11;
  150.     hookReserved3                = 12;
  151.     hookReserved4                = 13;
  152. {    "virtual" hookProc items    }
  153.     hookNull                    = 100;
  154.     hookItemRefresh                = 101;
  155.     hookZoneRefresh                = 102;
  156.     hookEject                    = 103;
  157.     hookPreflight                = 104;
  158.     hookPostflight                = 105;
  159.     hookKeyBase                    = 1000;
  160.  
  161. {    NuLookup structures/constants    }
  162.  
  163. TYPE
  164.     NLTypeEntry = RECORD
  165.         hIcon:                    Handle;
  166.         typeStr:                Str32;
  167.     END;
  168.     NLType = ARRAY [0..3] OF NLTypeEntry;
  169.  
  170.     NBPReply = RECORD
  171.         theEntity:                EntityName;
  172.         theAddr:                AddrBlock;
  173.     END;
  174.     NameFilterProcPtr = ProcPtr;  { FUNCTION NameFilter(VAR theEntity: EntityName): INTEGER; }
  175.     NameFilterUPP = UniversalProcPtr;
  176.  
  177. CONST
  178.     uppNameFilterProcInfo = $000000E0; { FUNCTION (4 byte param): 2 byte result; }
  179.  
  180. FUNCTION NewNameFilterProc(userRoutine: NameFilterProcPtr): NameFilterUPP;
  181.     {$IFC NOT GENERATINGCFM }
  182.     INLINE $2E9F;
  183.     {$ENDC}
  184.  
  185. FUNCTION CallNameFilterProc(VAR theEntity: EntityName; userRoutine: NameFilterUPP): INTEGER;
  186.     {$IFC NOT GENERATINGCFM}
  187.     INLINE $205F, $4E90;
  188.     {$ENDC}
  189. TYPE
  190.     ZoneFilterProcPtr = ProcPtr;  { FUNCTION ZoneFilter(theZone: ConstStr32Param): INTEGER; }
  191.     ZoneFilterUPP = UniversalProcPtr;
  192.  
  193. CONST
  194.     uppZoneFilterProcInfo = $000000E0; { FUNCTION (4 byte param): 2 byte result; }
  195.  
  196. FUNCTION NewZoneFilterProc(userRoutine: ZoneFilterProcPtr): ZoneFilterUPP;
  197.     {$IFC NOT GENERATINGCFM }
  198.     INLINE $2E9F;
  199.     {$ENDC}
  200.  
  201. FUNCTION CallZoneFilterProc(theZone: ConstStr32Param; userRoutine: ZoneFilterUPP): INTEGER;
  202.     {$IFC NOT GENERATINGCFM}
  203.     INLINE $205F, $4E90;
  204.     {$ENDC}
  205.  
  206. FUNCTION InitCTBUtilities: CTBUErr;
  207. FUNCTION CTBGetCTBVersion: INTEGER;
  208. FUNCTION StandardNBP(where: Point; prompt: ConstStr255Param; numTypes: INTEGER; VAR typeList: NLType; nameFilter: NameFilterUPP; zoneFilter: ZoneFilterUPP; hook: DialogHookUPP; VAR theReply: NBPReply): INTEGER;
  209. FUNCTION CustomNBP(where: Point; prompt: ConstStr255Param; numTypes: INTEGER; VAR typeList: NLType; nameFilter: NameFilterUPP; zoneFilter: ZoneFilterUPP; hook: DialogHookUPP; userData: LONGINT; dialogID: INTEGER; filter: ModalFilterUPP; VAR theReply: NBPReply): INTEGER;
  210. {$IFC OLDROUTINENAMES }
  211. FUNCTION NuLookup(where: Point; prompt: ConstStr255Param; numTypes: INTEGER; VAR typeList: NLType; nameFilter: NameFilterUPP; zoneFilter: ZoneFilterUPP; hook: DialogHookUPP; VAR theReply: NBPReply): INTEGER;
  212. FUNCTION NuPLookup(where: Point; prompt: ConstStr255Param; numTypes: INTEGER; VAR typeList: NLType; nameFilter: NameFilterUPP; zoneFilter: ZoneFilterUPP; hook: DialogHookUPP; userData: LONGINT; dialogID: INTEGER; filter: ModalFilterUPP; VAR theReply: NBPReply): INTEGER;
  213. {$ENDC}
  214.  
  215. {$ALIGN RESET}
  216. {$POP}
  217.  
  218. {$SETC UsingIncludes := CTBUtilitiesIncludes}
  219.  
  220. {$ENDC} {__CTBUTILITIES__}
  221.  
  222. {$IFC NOT UsingIncludes}
  223.  END.
  224. {$ENDC}
  225.